"""
    'c': ctypes.c_char,  'u': ctypes.c_wchar,
    'b': ctypes.c_byte,  'B': ctypes.c_ubyte,
    'h': ctypes.c_short, 'H': ctypes.c_ushort,
    'i': ctypes.c_int,   'I': ctypes.c_uint,  （其u表示无符号）
    'l': ctypes.c_long,  'L': ctypes.c_ulong,
    'f': ctypes.c_float, 'd': ctypes.c_double
"""

from multiprocessing import Process, Value, Array

def fun(n, m1, m2, arr):
    n.value = 888
    m1.value = 'a'.encode('utf-8')
    m2.value = "明"
    arr[0] = 888

if __name__ == '__main__':
    num = Value('i', 666)
    v1 = Value('c')  # 字符串
    v2 = Value('u')  # unicode 字符,包括中文

    arr = Array('i', [11,22,33,44])  # 数组：元素类型必须是int,只能是这么几个数据

    p = Process(target=fun, args=(num, v1, v2, arr))
    p.start()
    p.join()  # 等待子进程执行完毕

    print(num.value)
    print(v1.value)
    print(v2.value)
    print(arr[:])